local yinghuo = fk.CreateSkill {
  name = "th_yinghuo",
}

yinghuo:addEffect(fk.TargetConfirming, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(yinghuo.name) and data.from ~= nil and data.from ~= player and
    data.card and data.from:compareDistance(player, player.hp, ">=") and not player:isKongcheng()
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local discard = room:askToDiscard(player, {
      min_num = 1,
      max_num = 1,
      include_equip = false,
      skill_name = yinghuo.name,
      cancelable = true,
      pattern = ".|.|.|hand",
      prompt = "#th_yinghuo-ask:::"..data.card:toLogString(),
      skip = true,
    })
    if #discard == 1 then
      event:setCostData(self, { cards = discard })
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = event:getCostData(self).cards
    room:throwCard(cards, yinghuo.name, player, player)
    data:cancelTarget(player)
  end,
})
Fk:loadTranslationTable{
  ["th_yinghuo"] = "萤火",
  [":th_yinghuo"] = "你成为与你距离不小于你体力值的其他角色的牌的目标时，你可以弃置一张手牌取消此目标。",

  ["#th_yinghuo-ask"] = "萤火：你可以弃置一张手牌，取消 %arg 对你的目标",
}

return yinghuo